package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

@AllArgsConstructor
@Getter
public enum ReceivedCollectionType {

    BUY(1,"购买"),
    INTEGRAL(2,"积分兑换"),
    AIRDROP(3,"空投"),
    GIVE(4,"赠送"),
    RECEIVED(5,"收到"),
    INVITE_TASKS(6,"邀请任务"),
    SYNTHESIS(7,"合成"),
    LOTTERY(8,"轮盘抽奖"),
    GIVEAWAY(9,"赠品"),
    EXCHANGECDK(10,"CDK兑换"),
    CONSIGN(11,"寄售"),
    BOX_EXCHANGE(12,"盲盒兑换"),
    ACTIVITY(13,"活动"),
    EXCHANGE_COLLECTION(14, "兑换藏品"),
    RECYCLE(15, "系统回收"),
    ROUGH_STONE(16, "MT原石商品"),
    ECOLOGY_HATCH(17, "生态铸造"),
    ECOLOGY_DESTROY(18, "生态销毁"),
    TRANSFER_TO_META_WALLET(19, "转至iMeta Wallet"),
    TRANSFER_FROM_META_WALLET(20, "iMeta Wallet转入"),
    AUCTION(21,"竞拍"),
    COLLECTIVE(22,"集售"),
    CHIP(23, "芯片NFC"),
    TRADING_POOL(24,"交易池"),
    TRADING_DESTROY(25,"交易池藏品销毁"),
    PLEDGE_DESTROY(26,"质押藏品销毁"),
            ;

    @EnumValue
    private int code;
    private String description;

    public static ReceivedCollectionType getName(Integer code) {
        ReceivedCollectionType[] values = values();
        for (ReceivedCollectionType v : values) {
            if (v.getCode()==code) {
                return v;
            }
        }
        return null;
    }

    public static List<ReceivedCollectionType> PlatformTransaction() {
        List<ReceivedCollectionType> list = Lists.newArrayList();
        list.add(BUY);
        list.add(INTEGRAL);
        list.add(AIRDROP);
        list.add(INVITE_TASKS);
        list.add(SYNTHESIS);
        list.add(LOTTERY);
        list.add(GIVEAWAY);
        list.add(EXCHANGECDK);
        list.add(BOX_EXCHANGE);
        list.add(ACTIVITY);
        list.add(EXCHANGE_COLLECTION);
        list.add(RECYCLE);
        list.add(ROUGH_STONE);
        list.add(ECOLOGY_HATCH);
        return list;
    }
}


